<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>ECharts</title>
    <!-- 引入刚刚下载的 ECharts 文件 -->
    <script src="echarts.js"></script>
  </head>
  <body>
    <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
    <div id="main" style="width: 600px;height:400px;"></div>
    <script src="./jquery-3.6.0.min.js"></script>
    <script type="text/javascript">
      // 基于准备好的dom，初始化echarts实例
      var myChart = echarts.init(document.getElementById('main'));
      var option;
      // 指定图表的配置项和数据
      var res;
      //var senddata={"username":"zhaocuixia","password":"xiaocuicui"}
     
      $.ajax({
        contentType:"application/x-www-form-urlencoded",
        type:"POST",
        url:"http://127.0.0.1:8000/test/login",
        //data:{"data":senddata},
        data:{
          "username":"zhaocuixia"
          "password":"xiaocuicui"
        }
        dataType:"text",
        success:function (data){
          res=data
          myChart.setOption(option = {
            title: {
              text: res
            },
            tooltip: {},
            legend: {
              data: ['销量1']
            },
            xAxis: {
              data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
            },
            yAxis: {},
            series: [
              {
                name: '销量1',
                type: 'bar',
                data: [5, 20, 36, 10, 10, 20]
              }
            ]
          });

        }
        


      });
     
       

      // 使用刚指定的配置项和数据显示图表。
      
    </script>
  </body>
</html>
